package com.ylfstu.interface_;

public class Interface01 {
    public static void main(String[] args) {
        Camera camera = new Camera();
        Phone phone = new Phone();

        Computer computer = new Computer();

        computer.work(camera);
        computer.work(phone);

        UsbInterface[] usb = new UsbInterface[3];
        usb[0] = new Camera();
        usb[1] = new Phone();
        usb[2] = new Camera();
        for (int i = 0; i < usb.length; i++) {
            usb[i].start();
            usb[i].stop();
            if (usb[i] instanceof Camera) {
                ((Camera) usb[i]).fun();
            }
        }
    }
}
